

import React from 'react';
import ReactDOM from 'react-dom';

import { createHashHistory } from 'history';

import { Router, Route, useRouterHistory } from 'react-router';

import { syncHistoryWithStore, RouterStore } from 'mobx-react-router';

import { Provider } from 'mobx-react';


import Car from './index'; // umd
// import Workflow from './index'
import { IndexRedirect } from 'react-router';

const CarStore = Car.store;
const routing = new RouterStore();
const CarRoute = Car.Route;
import Comstore from 'comsMobx';

const ComStore = Comstore.store;
import './style/single.less';

const stores = {
  // Key can be whatever you want
  routing,
  ...ComStore,
  ...CarStore,
};

const browserHistory = useRouterHistory(createHashHistory)({
  queryKey: '_key',
  basename: '/',
});

const history = syncHistoryWithStore(browserHistory, stores.routing);

class Home extends React.Component {
  render() {
    return this.props.children;
  }
}

class Root extends React.Component {
  render() {
    return (
      <Provider ecId={`${this && this.props && this.props.ecId || ''}_Provider@428gmz`} {...stores}>
        <Router ecId={`${this && this.props && this.props.ecId || ''}_Router@olxop5`} history={history}>
          <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@p1asha`} path="/">
            <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@t2hzrd`} name="main" breadcrumbName="入口" path="main" component={Home}>
              {CarRoute}
            </Route>
            <IndexRedirect ecId={`${this && this.props && this.props.ecId || ''}_IndexRedirect@9f96w3`} to="main/car/carUseView" />
          </Route>
        </Router>
      </Provider>
    );
  }
}

ReactDOM.render(<Root ecId={`${this && this.props && this.props.ecId || ''}_Root@dpqmue`} />, document.getElementById('container'));
